import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: "/",
    name: "Home",
    component: () => import("../views/Home"),
    meta: {
      requireAuth: true
    }
  },
  {
    path: '/search',
    name: 'search',
    component: () => import("../views/Search"),
    meta: {
      requireAuth: true
    }
  },
  {
    path: '/setting',
    name: 'setting',
    component: () => import("../views/Setting"),
    meta: {
      requireAuth: true
    }
  },
  {
    path: '/settingword',
    name: 'settingword',
    component: () => import("../views/settingWord"),
    meta: {
      requireAuth: true
    }
  },
  {
    path: '/forget',
    name: 'forget',
    component: () => import("../views/Forget"),
  },
  {
    path: '/detail',
    name: 'detail',
    component: () => import("../views/Detail"),
  },


];

const router = new VueRouter({
  routes,
});

export default router;





